package com.wuliu.config;

import com.wuliu.interceptor.AppletInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author realue
 * @version 1.0
 * @date 2022-10-12 17:47
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Resource
    private AppletInterceptor appletInterceptor;

    //注册拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry)
    {
        registry.addInterceptor(appletInterceptor).addPathPatterns("/**")
                .excludePathPatterns("/swagger-ui/**","/swagger-resources/**","/v3/api-docs");
    }
}
